import 'package:get/get.dart';
import 'package:inmotion_pro/http/api_helper.dart';
import 'package:inmotion_pro/http/api_helper_vehicle.dart';
import 'package:inmotion_pro/service/log_service.dart';

class VehicleDataUploadService extends GetxService {
  // 车辆数据上传服务
  static VehicleDataUploadService get to => Get.find();

  // 上传车辆连接信息
  Future<bool> uploadVehicleConnectedInfo(String sn, String connectionInfo) {
    return ApiHelper()
        .uploadVehicleConnectionInfo(sn, connectionInfo)
        .then((success) {
      if (success) {
        LogService.to.info("✅ 上传车辆连接信息成功");
        return true;
      } else {
        LogService.to.error("❌ 上传车辆连接信息失败");
        return false;
      }
    });
  }
}
